PATHMac OS 8 and 9 Developer Documentation > Interapplication Communication > AppleScript for Scripters >

AppleScript Language Guide

   

Greater Than, Less Than

The Greater Than and Less Than operators work with dates, integers, real numbers, and strings.

Table 6-1, AppleScript operators summarizes the Greater Than and Less Than operators and other AppleScript operators.

DATE

A date is greater than another date if it represents a later time. A date is less than another date if it represents an earlier time.

INTEGER

An integer is greater than a real number or another integer if it represents a larger number. An integer is less than a real number or another integer if it represents a smaller number.

REAL

A real number is greater than an integer or another real number if it represents a larger number. A real number is less than an integer or another real number if it represents a smaller number.

STRING

A string is greater than (comes after) another string if it would appear after the other string in an English-language dictionary. For example,

"zebra" comes after "aardvark"

and

"zebra" > "aardvark"

are true . A string is less than (comes before) another string if it would appear in a dictionary before the other string. For example,

"aardvark" comes before "zebra"

and

"aardvark" < "zebra"

are true .

AppleScript uses the language-defined collating sequence specified by the Text control panel to determine a word's position in an English-language dictionary. The order of the collating sequence, in the English language and Roman script, is

space!"#$%&'()*+,-./
0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`{|}~

AppleScript compares strings character by character. When the corresponding characters in two strings are not the same, the string containing the character closest to the beginning of the collating sequence is less than the other string. If two strings have identical characters but one is shorter than the other, the shorter string is less than the longer string. AppleScript treats all letters as lowercase letters, unless you use a Considering statement to consider the case attribute, in which case letters are ordered as follows, in the English language and Roman script:

AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz

If you use a Considering statement that considers the diacriticals attribute, AppleScript uses the following ordering for vowels, in the English language and Roman script:

a á à â ä ã å
e é è ê ë
i í ì î ï
o ó ò ô ö õ
u ú ù û ü

For more information about Considering statements, refer to Considering and Ignoring Statements.


© 1999 Apple Computer, Inc. – (Last Updated 21 May 99)